package com.xyebank.ledger.util;

/**
 *
 *
 * @author rcl:
 * @version 创建时间：2018年9月12日 下午2:07:54
 * 
 */
public class StatusConvertUtil {
    public static String convertApplyStatus(String oldStatus) {
        String newStatus = null;
        switch (oldStatus) {
        case "审核中":
            newStatus = "1";
            break;

        case "申请成功":
            newStatus = "2";
            break;

        case "申请失败":
            newStatus = "3";
            break;

        case "停用":
            newStatus = "4";
            break;

        case "作废":
            newStatus = "501";
            break;

        case "冻结":
            newStatus = "6";
            break;
            
        case "applying":
            newStatus = "1";
            break;
            
        case "apply_failed":
            newStatus = "3";
            break;
            
        case "apply_success":
            newStatus = "2";
            break;
            
        case "freeze":
            newStatus = "6";
            break;
            
        case "cancelled":
            newStatus = "501";
            break;
            
        case "000":
            newStatus = "2";
            break;
            
        case "001":
            newStatus = "1";
            break;
            
        case "002":
            newStatus = "201";
            break;
            
        case "003":
            newStatus = "3";
            break;
            
        case "004":
            newStatus = "302";
            break;

//  中邮开始----------           
        case "审批未通过":
            newStatus = "3";
            break;
            
        case "审批通过":
            newStatus = "2";
            break;
//  中邮结束
            
        default:
            // newStatus = "unknown";
            break;
        }
        return newStatus;
    }



    public static String convertPayStatus(String oldStatus) {
        String newStatus = null;
        switch (oldStatus) {
        
        case "paying":
            newStatus = "1";
            break;
            
        case "pay_failed":
            newStatus = "3";
            break;
            
        case "overdue":
            newStatus = "2";
            break;
            
        case "settled":
            newStatus = "2";
            break;
            
        case "cancelled":
            newStatus = "2";
            break;
            
        case "repaying":
            newStatus = "2";
            break;

// 中邮放款开始--------------------------------------------------------        
        case "MAKELOAN_PROCESSING":
            newStatus = "1";
            break;
            
        case "MAKELOAN_SUCCESS":
            newStatus = "2";
            break;
            
        case "MAKELOAN_FAILURE":
            newStatus = "301";
            break;
            
        case "MAKELOAN_EXCEPTION":
            newStatus = "302";
            break;
// 中邮放款结束--------------------------------------------------------      
            
            
// 招联放款开始--------------------------------------------------------            
        case "00":
            newStatus = "201";
            break;    
            
        case "01":
            newStatus = "202";
            break;    
            
        case "02":
            newStatus = "203";
            break;    
// 招联放款结束--------------------------------------------------------            
        default:
            break;
        }
        return newStatus;
    }
    
    
    
    public static String convertRepayStatus(String oldStatus) {
        String newStatus = null;
        switch (oldStatus) {
        
        case "overdue":
            newStatus = "1";
            break;

        case "wait_to_repay":
            newStatus = "2";
            break;

        case "settled":
            newStatus = "3";
            break;
            
        case "repaying":
            newStatus = "5";
            break;

        default:
            newStatus = "unknown";
            break;
        }
        return newStatus;
    }
}
